﻿
namespace SX.AuthServer
{
    /// <summary>
    /// appsetting.json配置
    /// </summary>
    public class AppSettings
    {
        /// <summary>
        /// Api地址，默认 https://localhost:5000
        /// </summary>
        public string Urls { get; set; }

        /// <summary>
        /// 证书
        /// </summary>
        public Certificate Certificate { get; set; } = new Certificate();

        /// <summary>
        /// 数据库链接字符串
        /// </summary>
        public string ConnectionString { get; set; }

        /// <summary>
        /// Admin前端客户端
        /// </summary>
        public AdminUI AdminUI { get; set; } = new AdminUI();


        /// <summary>
        /// 跨域地址，默认 http://*:8000
        /// </summary>
        public string[] CorUrls { get; set; }// = new[]{ "http://*:8000" };
    }

    /// <summary>
    /// 证书
    /// </summary>
    public class Certificate
    {
        /// <summary>
        /// 地址
        /// </summary>
        public string Path { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        public string Password { get; set; }
    }
    /// <summary>
    /// Admin前端客户端
    /// </summary>
    public class AdminUI
    {
        /// <summary>
        /// 登录成功跳转地址
        /// </summary>
        public string[] RedirectUris { get; set; }

        /// <summary>
        /// 退出登录跳转地址
        /// </summary>
        public string[] PostLogoutRedirectUris { get; set; }

        /// <summary>
        /// 密钥
        /// </summary>
        public string Secret { get; set; } = "secret";

        /// <summary>
        /// token有效时间
        /// </summary>
        public int AccessTokenLifetime { get; set; } = 7200;
    }
}